/**
 * create by hp
 * date 2020/3/7 12:30
 * @type {string[]}
 */

import * as Client from 'ssh2-sftp-client'

export function SftpHelper(conf) {
  let sftp = new Client()
  sftp.connect({
    host: '127.0.0.1',
    port: '8080',
    username: 'username',
    password: '******'
  }).then(() => {
    return sftp.list('/pathname');
  }).then(data => {
    console.log(data, 'the data info');
  }).catch(err => {
    console.log(err, 'catch error');
  })
}
